import os
import pandas as pd
from pprint import pprint

class DataOperation:
    def __init__(self, path):
        self.data = pd.read_csv(path)

    def get_data_to_dict(self):
        # [{},{},{}, ....]
        return [self.data.loc[i].to_dic() for i in self.data.index.values]

    def get_data_to_list(self):
        # [[],[],[], ....]
        return self.data.values.tolist()

if __name__ == '__main__':
    project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    path = os.path.join(project_path, 'data/lj_data.csv')   #专门用来拼接路径
    data = DataOperation(path)
    pprint(data.get_data_to_list())